<template>
  <view class="yang" :style="{ height: props.height + 'rpx' }"> </view>
  <view class="fanhuis">
    <uni-icons v-if="left" @click="tui" type="left" size="20"></uni-icons>
    <view v-else style="width: 10rpx; height: 10rpx"></view>
    <text class="title" :style="{ color: props.color }">{{ props.title }}</text>
    <view style="width: 10rpx; height: 10rpx"></view>
  </view>
</template>

<script setup>
const props = defineProps({
  title: {
    default: "",
  },
  color: {
    default: "#000",
  },
  left: {
    default: true,
  },
  height: { default: 110 },
});

const tui = () => {
  // uni.showTabBar()
  if(props.title=='登录'){
  uni.switchTab({
	url: '/pages/index/index'
});

  }else{
    uni.navigateBack({
    delta: 1,
  });
  }

};
</script>

<style scoped lang="scss">
.fanhuis {
  padding: 0 20rpx;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 50rpx;
  .title {
    font-weight: 700;
    text-align: center;
    font-size: 32rpx;
  }
}
</style>
